/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "SharedData.h"

namespace oai::udr::model {

SharedData::SharedData() {
  m_SharedDataId = "";
  m_SharedAmDataIsSet = false;
  m_SharedSmsSubsDataIsSet = false;
  m_SharedSmsMngSubsDataIsSet = false;
  m_SharedDnnConfigurationsIsSet = false;
  m_SharedTraceDataIsSet = false;
  m_SharedSnssaiInfosIsSet = false;
  m_SharedVnGroupDatasIsSet = false;
}

SharedData::~SharedData() {}

void SharedData::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const SharedData &o) {
  j = nlohmann::json();
  j["sharedDataId"] = o.m_SharedDataId;
  if (o.sharedAmDataIsSet())
    j["sharedAmData"] = o.m_SharedAmData;
  if (o.sharedSmsSubsDataIsSet())
    j["sharedSmsSubsData"] = o.m_SharedSmsSubsData;
  if (o.sharedSmsMngSubsDataIsSet())
    j["sharedSmsMngSubsData"] = o.m_SharedSmsMngSubsData;
  if (o.sharedDnnConfigurationsIsSet() || !o.m_SharedDnnConfigurations.empty())
    j["sharedDnnConfigurations"] = o.m_SharedDnnConfigurations;
  if (o.sharedTraceDataIsSet())
    j["sharedTraceData"] = o.m_SharedTraceData;
  if (o.sharedSnssaiInfosIsSet() || !o.m_SharedSnssaiInfos.empty())
    j["sharedSnssaiInfos"] = o.m_SharedSnssaiInfos;
  if (o.sharedVnGroupDatasIsSet() || !o.m_SharedVnGroupDatas.empty())
    j["sharedVnGroupDatas"] = o.m_SharedVnGroupDatas;
}

void from_json(const nlohmann::json &j, SharedData &o) {
  j.at("sharedDataId").get_to(o.m_SharedDataId);
  if (j.find("sharedAmData") != j.end()) {
    j.at("sharedAmData").get_to(o.m_SharedAmData);
    o.m_SharedAmDataIsSet = true;
  }
  if (j.find("sharedSmsSubsData") != j.end()) {
    j.at("sharedSmsSubsData").get_to(o.m_SharedSmsSubsData);
    o.m_SharedSmsSubsDataIsSet = true;
  }
  if (j.find("sharedSmsMngSubsData") != j.end()) {
    j.at("sharedSmsMngSubsData").get_to(o.m_SharedSmsMngSubsData);
    o.m_SharedSmsMngSubsDataIsSet = true;
  }
  if (j.find("sharedDnnConfigurations") != j.end()) {
    j.at("sharedDnnConfigurations").get_to(o.m_SharedDnnConfigurations);
    o.m_SharedDnnConfigurationsIsSet = true;
  }
  if (j.find("sharedTraceData") != j.end()) {
    j.at("sharedTraceData").get_to(o.m_SharedTraceData);
    o.m_SharedTraceDataIsSet = true;
  }
  if (j.find("sharedSnssaiInfos") != j.end()) {
    j.at("sharedSnssaiInfos").get_to(o.m_SharedSnssaiInfos);
    o.m_SharedSnssaiInfosIsSet = true;
  }
  if (j.find("sharedVnGroupDatas") != j.end()) {
    j.at("sharedVnGroupDatas").get_to(o.m_SharedVnGroupDatas);
    o.m_SharedVnGroupDatasIsSet = true;
  }
}

std::string SharedData::getSharedDataId() const { return m_SharedDataId; }
void SharedData::setSharedDataId(std::string const &value) {
  m_SharedDataId = value;
}
AccessAndMobilitySubscriptionData SharedData::getSharedAmData() const {
  return m_SharedAmData;
}
void SharedData::setSharedAmData(
    AccessAndMobilitySubscriptionData const &value) {
  m_SharedAmData = value;
  m_SharedAmDataIsSet = true;
}
bool SharedData::sharedAmDataIsSet() const { return m_SharedAmDataIsSet; }
void SharedData::unsetSharedAmData() { m_SharedAmDataIsSet = false; }
SmsSubscriptionData SharedData::getSharedSmsSubsData() const {
  return m_SharedSmsSubsData;
}
void SharedData::setSharedSmsSubsData(SmsSubscriptionData const &value) {
  m_SharedSmsSubsData = value;
  m_SharedSmsSubsDataIsSet = true;
}
bool SharedData::sharedSmsSubsDataIsSet() const {
  return m_SharedSmsSubsDataIsSet;
}
void SharedData::unsetSharedSmsSubsData() { m_SharedSmsSubsDataIsSet = false; }
SmsManagementSubscriptionData SharedData::getSharedSmsMngSubsData() const {
  return m_SharedSmsMngSubsData;
}
void SharedData::setSharedSmsMngSubsData(
    SmsManagementSubscriptionData const &value) {
  m_SharedSmsMngSubsData = value;
  m_SharedSmsMngSubsDataIsSet = true;
}
bool SharedData::sharedSmsMngSubsDataIsSet() const {
  return m_SharedSmsMngSubsDataIsSet;
}
void SharedData::unsetSharedSmsMngSubsData() {
  m_SharedSmsMngSubsDataIsSet = false;
}
std::map<std::string, DnnConfiguration> &
SharedData::getSharedDnnConfigurations() {
  return m_SharedDnnConfigurations;
}
void SharedData::setSharedDnnConfigurations(
    std::map<std::string, DnnConfiguration> const &value) {
  m_SharedDnnConfigurations = value;
  m_SharedDnnConfigurationsIsSet = true;
}
bool SharedData::sharedDnnConfigurationsIsSet() const {
  return m_SharedDnnConfigurationsIsSet;
}
void SharedData::unsetSharedDnnConfigurations() {
  m_SharedDnnConfigurationsIsSet = false;
}
TraceData SharedData::getSharedTraceData() const { return m_SharedTraceData; }
void SharedData::setSharedTraceData(TraceData const &value) {
  m_SharedTraceData = value;
  m_SharedTraceDataIsSet = true;
}
bool SharedData::sharedTraceDataIsSet() const { return m_SharedTraceDataIsSet; }
void SharedData::unsetSharedTraceData() { m_SharedTraceDataIsSet = false; }
std::map<std::string, SnssaiInfo> &SharedData::getSharedSnssaiInfos() {
  return m_SharedSnssaiInfos;
}
void SharedData::setSharedSnssaiInfos(
    std::map<std::string, SnssaiInfo> const &value) {
  m_SharedSnssaiInfos = value;
  m_SharedSnssaiInfosIsSet = true;
}
bool SharedData::sharedSnssaiInfosIsSet() const {
  return m_SharedSnssaiInfosIsSet;
}
void SharedData::unsetSharedSnssaiInfos() { m_SharedSnssaiInfosIsSet = false; }
std::map<std::string, VnGroupData> &SharedData::getSharedVnGroupDatas() {
  return m_SharedVnGroupDatas;
}
void SharedData::setSharedVnGroupDatas(
    std::map<std::string, VnGroupData> const &value) {
  m_SharedVnGroupDatas = value;
  m_SharedVnGroupDatasIsSet = true;
}
bool SharedData::sharedVnGroupDatasIsSet() const {
  return m_SharedVnGroupDatasIsSet;
}
void SharedData::unsetSharedVnGroupDatas() {
  m_SharedVnGroupDatasIsSet = false;
}

} // namespace oai::udr::model
